SELECT
<#assign prefixName = true>
<#if (select_batchNo??)>
${prefixName?string('  ', ', ')}batch_no
<#assign prefixName = false>
</#if>
<#if (select_beginDate??)>
${prefixName?string('  ', ', ')}begin_date
<#assign prefixName = false>
</#if>
<#if (select_beginTime??)>
${prefixName?string('  ', ', ')}begin_time
<#assign prefixName = false>
</#if>
<#if (select_businessCode??)>
${prefixName?string('  ', ', ')}business_code
<#assign prefixName = false>
</#if>
<#if (select_businessId??)>
${prefixName?string('  ', ', ')}business_id
<#assign prefixName = false>
</#if>
<#if (select_businessTypeCode??)>
${prefixName?string('  ', ', ')}business_type_code
<#assign prefixName = false>
</#if>
<#if (select_createdByCode??)>
${prefixName?string('  ', ', ')}created_by_code
<#assign prefixName = false>
</#if>
<#if (select_createdById??)>
${prefixName?string('  ', ', ')}created_by_id
<#assign prefixName = false>
</#if>
<#if (select_createdDate??)>
${prefixName?string('  ', ', ')}created_date
<#assign prefixName = false>
</#if>
<#if (select_dataStateCode??)>
${prefixName?string('  ', ', ')}data_state_code
<#assign prefixName = false>
</#if>
<#if (select_departmentCode??)>
${prefixName?string('  ', ', ')}department_code
<#assign prefixName = false>
</#if>
<#if (select_endDate??)>
${prefixName?string('  ', ', ')}end_date
<#assign prefixName = false>
</#if>
<#if (select_endTime??)>
${prefixName?string('  ', ', ')}end_time
<#assign prefixName = false>
</#if>
<#if (select_errorDate??)>
${prefixName?string('  ', ', ')}error_date
<#assign prefixName = false>
</#if>
<#if (select_errorMessage??)>
${prefixName?string('  ', ', ')}error_message
<#assign prefixName = false>
</#if>
<#if (select_flagCode??)>
${prefixName?string('  ', ', ')}flag_code
<#assign prefixName = false>
</#if>
<#if (select_flagObjectCode??)>
${prefixName?string('  ', ', ')}flag_object_code
<#assign prefixName = false>
</#if>
<#if (select_handleCode??)>
${prefixName?string('  ', ', ')}handle_code
<#assign prefixName = false>
</#if>
<#if (select_jsonData??)>
${prefixName?string('  ', ', ')}json_data
<#assign prefixName = false>
</#if>
<#if (select_lastModifiedByCode??)>
${prefixName?string('  ', ', ')}last_modified_by_code
<#assign prefixName = false>
</#if>
<#if (select_lastModifiedById??)>
${prefixName?string('  ', ', ')}last_modified_by_id
<#assign prefixName = false>
</#if>
<#if (select_lastModifiedDate??)>
${prefixName?string('  ', ', ')}last_modified_date
<#assign prefixName = false>
</#if>
<#if (select_lastRetryDate??)>
${prefixName?string('  ', ', ')}last_retry_date
<#assign prefixName = false>
</#if>
<#if (select_nextRetryTime??)>
${prefixName?string('  ', ', ')}next_retry_time
<#assign prefixName = false>
</#if>
<#if (select_orderBy??)>
${prefixName?string('  ', ', ')}order_by_
<#assign prefixName = false>
</#if>
<#if (select_orgCode??)>
${prefixName?string('  ', ', ')}org_code
<#assign prefixName = false>
</#if>
<#if (select_personalCode??)>
${prefixName?string('  ', ', ')}personal_code
<#assign prefixName = false>
</#if>
<#if (select_personalId??)>
${prefixName?string('  ', ', ')}personal_id
<#assign prefixName = false>
</#if>
<#if (select_retryCount??)>
${prefixName?string('  ', ', ')}retry_count
<#assign prefixName = false>
</#if>
<#if (select_retryCountUpperLimit??)>
${prefixName?string('  ', ', ')}retry_count_upper_limit
<#assign prefixName = false>
</#if>
<#if (select_siteCode??)>
${prefixName?string('  ', ', ')}site_code
<#assign prefixName = false>
</#if>
<#if (select_stateCode??)>
${prefixName?string('  ', ', ')}state_code
<#assign prefixName = false>
</#if>
<#if (select_systemInfoCode??)>
${prefixName?string('  ', ', ')}system_info_code
<#assign prefixName = false>
</#if>
<#if (select_version??)>
${prefixName?string('  ', ', ')}version_
<#assign prefixName = false>
</#if>
<#if (select_wfTaskId??)>
${prefixName?string('  ', ', ')}wf_task_id
<#assign prefixName = false>
</#if>
<#if (select_yyyy??)>
${prefixName?string('  ', ', ')}yyyy
<#assign prefixName = false>
</#if>
<#if (select_yyyyMm??)>
${prefixName?string('  ', ', ')}yyyy_mm
<#assign prefixName = false>
</#if>
<#if (select_yyyyMmDd??)>
${prefixName?string('  ', ', ')}yyyy_mm_dd
<#assign prefixName = false>
</#if>
<#if prefixName>
*
</#if>
FROM c1_wf_task
<#include "where.ftl">
<#assign prefixName = true>
<#if (order_by_batchNo??)>
${prefixName?string('ORDER BY ', ', ')}batch_no ${order_by_batchNo_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_beginDate??)>
${prefixName?string('ORDER BY ', ', ')}begin_date ${order_by_beginDate_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_beginTime??)>
${prefixName?string('ORDER BY ', ', ')}begin_time ${order_by_beginTime_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_businessCode??)>
${prefixName?string('ORDER BY ', ', ')}business_code ${order_by_businessCode_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_businessId??)>
${prefixName?string('ORDER BY ', ', ')}business_id ${order_by_businessId_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_businessTypeCode??)>
${prefixName?string('ORDER BY ', ', ')}business_type_code ${order_by_businessTypeCode_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_createdByCode??)>
${prefixName?string('ORDER BY ', ', ')}created_by_code ${order_by_createdByCode_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_createdById??)>
${prefixName?string('ORDER BY ', ', ')}created_by_id ${order_by_createdById_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_createdDate??)>
${prefixName?string('ORDER BY ', ', ')}created_date ${order_by_createdDate_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_dataStateCode??)>
${prefixName?string('ORDER BY ', ', ')}data_state_code ${order_by_dataStateCode_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_departmentCode??)>
${prefixName?string('ORDER BY ', ', ')}department_code ${order_by_departmentCode_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_endDate??)>
${prefixName?string('ORDER BY ', ', ')}end_date ${order_by_endDate_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_endTime??)>
${prefixName?string('ORDER BY ', ', ')}end_time ${order_by_endTime_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_errorDate??)>
${prefixName?string('ORDER BY ', ', ')}error_date ${order_by_errorDate_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_errorMessage??)>
${prefixName?string('ORDER BY ', ', ')}error_message ${order_by_errorMessage_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_flagCode??)>
${prefixName?string('ORDER BY ', ', ')}flag_code ${order_by_flagCode_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_flagObjectCode??)>
${prefixName?string('ORDER BY ', ', ')}flag_object_code ${order_by_flagObjectCode_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_handleCode??)>
${prefixName?string('ORDER BY ', ', ')}handle_code ${order_by_handleCode_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_jsonData??)>
${prefixName?string('ORDER BY ', ', ')}json_data ${order_by_jsonData_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_lastModifiedByCode??)>
${prefixName?string('ORDER BY ', ', ')}last_modified_by_code ${order_by_lastModifiedByCode_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_lastModifiedById??)>
${prefixName?string('ORDER BY ', ', ')}last_modified_by_id ${order_by_lastModifiedById_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_lastModifiedDate??)>
${prefixName?string('ORDER BY ', ', ')}last_modified_date ${order_by_lastModifiedDate_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_lastRetryDate??)>
${prefixName?string('ORDER BY ', ', ')}last_retry_date ${order_by_lastRetryDate_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_nextRetryTime??)>
${prefixName?string('ORDER BY ', ', ')}next_retry_time ${order_by_nextRetryTime_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_orderBy??)>
${prefixName?string('ORDER BY ', ', ')}order_by_ ${order_by_orderBy_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_orgCode??)>
${prefixName?string('ORDER BY ', ', ')}org_code ${order_by_orgCode_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_personalCode??)>
${prefixName?string('ORDER BY ', ', ')}personal_code ${order_by_personalCode_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_personalId??)>
${prefixName?string('ORDER BY ', ', ')}personal_id ${order_by_personalId_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_retryCount??)>
${prefixName?string('ORDER BY ', ', ')}retry_count ${order_by_retryCount_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_retryCountUpperLimit??)>
${prefixName?string('ORDER BY ', ', ')}retry_count_upper_limit ${order_by_retryCountUpperLimit_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_siteCode??)>
${prefixName?string('ORDER BY ', ', ')}site_code ${order_by_siteCode_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_stateCode??)>
${prefixName?string('ORDER BY ', ', ')}state_code ${order_by_stateCode_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_systemInfoCode??)>
${prefixName?string('ORDER BY ', ', ')}system_info_code ${order_by_systemInfoCode_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_version??)>
${prefixName?string('ORDER BY ', ', ')}version_ ${order_by_version_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_wfTaskId??)>
${prefixName?string('ORDER BY ', ', ')}wf_task_id ${order_by_wfTaskId_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_yyyy??)>
${prefixName?string('ORDER BY ', ', ')}yyyy ${order_by_yyyy_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_yyyyMm??)>
${prefixName?string('ORDER BY ', ', ')}yyyy_mm ${order_by_yyyyMm_value!}
<#assign prefixName = false>
</#if>
<#if (order_by_yyyyMmDd??)>
${prefixName?string('ORDER BY ', ', ')}yyyy_mm_dd ${order_by_yyyyMmDd_value!}
<#assign prefixName = false>
</#if>
